package test;

import java.util.Scanner;

public class TheJudgesScored {
    public static void main(String[] args) {
        // 第一次录入成绩，记录成min和max
        Scanner scanner = new Scanner(System.in);
        double max = 0;
        double min = 0;
        double sum = 0;

        for (int i = 0; i < 6; i++) {
            double scores = scanner.nextDouble();
            if(i==0){
                min = scores;
                max = scores;
            }
            if (max < scores) max = scores;
            if (min > scores) min = scores;
            sum += scores ;
        }

        System.out.println((sum - min - max) / 4);


    }
}